class ABC {
private Name: string;
get name() : string {
return this.Name;
}
set name(setName: string){
this.Name = setName;
}
}
let abc = new ABC();
abc.name = "Albert Thomas"; //set property
console.log('My name is ' + abc.name); //get property
//Create a Set
let diceEntries = new Set();
//Add values
diceEntries.add(1);
diceEntries.add(2);
diceEntries.add(3);
diceEntries.add(4).add(5).add(6); //Chaining of add() method is allowed
//Check value is present or not
diceEntries.has(1); //true
diceEntries.has(10); //false
//Size of Set
diceEntries.size; //6
//Delete a value from set
diceEntries.delete(6); // true
//Clear whole Set
diceEntries.clear(); //Clear all entries